package com.zr.java8.pattern.factory;

public class FactoryPatternExample {
    public static void main(String[] args) {
        Car tesla = CarFactory.createCar("tesla");
        if (tesla != null) {
            tesla.drive();
        }

        Car bmw = CarFactory.createCar("bmw");
        if (bmw!=null){
            bmw.drive();
        }
    }
}
